{extend name="template/pc/cms-yuanxiao/_base.html" /}
{block name="css"}
{load href="__STATIC__/admin/hui/static/h-ui/css/H-ui.min.css" /}
<style type="text/css">
    .navbar {
        background: #383d41;
    }
</style>
{/block}

{block name="js"}

{load href="__STATIC__/admin/hui/lib/Validform/v5.3.2/Validform_v5.3.2_min.js" /}
<script type="text/javascript">
    $("#form").Validform({
        tiptype: 3,
        label: ".form-label",
        ajaxPost: true,
        showAllError: true,
        callback: function (data) {
            if (data.status == "y") {
                setTimeout(function () {
                    location.href = data.url;
                }, 1000);
            }
            if(data.status == "u"){
                window.location.reload();
            }

        }
    });
</script>
{/block}
{block name="main"}

<div class="container content">

    {include file="template/pc/cms-yuanxiao/_left.html"}

    <div class="right">

        {include file="template/pc/cms-yuanxiao/_right.html"}

        <div class="conY">
            {empty name=":session('User.name','','User')"}
                <div class="conY_tit">{$data.title}</div>

                <div class="conY_dat">用户登录才能查看考试内容</div>
            {else/}
            <div class="conY_tit">{$data.title}</div>
            <div class="conY_dat">{:lang('Author')}：{$data.issue??''}&nbsp;&nbsp;&nbsp;{:lang('Create time')}：{$data.create_time}</div>

            <!--<div class="conY_img"><img alt="" src="images/about-left.jpg"></div>-->

            <div class="conY_text">
                {$data.description|default=''|html_entity_decode ?? ''}
                <form id="form" name="" method="post" action="{:url('saveresearch')}">
                {volist name="list" id="ques" key="i"}
                <div class="question_box" id="question_info_{$i}">
                    <p class="question_info">
                        <span>问题<u>{$i}</u>：</span>
                        <label >{$ques['name']}</label>
                        {if condition="$ques['type'] eq 1"} <span> 允许多选</span>{/if}
                    </p>
                    {if condition="$ques['type'] eq 2"}
                    <textarea name="oid[{$ques['id']}]"></textarea>
                    {else/}
                    <ul id="{$i}" class="optionul">
                        {volist name="ques['answer']" id="answer" key="k"}
                        <li>
                            <span>&nbsp;
                                {if condition="$ques['type'] eq 1"}
                                <input type="checkbox" class="hide_txt" name="oid[{$ques['id']}][{$k}]" value="{$answer['question']}">
                                {elseif condition="$ques['type'] eq 0"/}
                                <input type="radio" class="hide_txt" name="oid[{$ques['id']}]" value="{$answer['question']}">
                                {/if}
                                <!--{$k}-->
                                {$answer['question']}</span>：
                            <span>{$answer['name']}</span>
                        </li>
                        {/volist}
                    </ul>
                    {/if}
                </div>
                {/volist}
                    <input name="" class="btn radius btn-primary" type="submit" value="提交">
                    <input name="id" type="hidden" value="{$data.id}">
                    <input name="title" type="hidden" value="{$data.title}">
                    <input name="" class="btn radius btn-default radius" type="reset" value="取消">
                </form>
            </div>
            {/empty}

            <div class="conY_fanye">
                <div class="conY_fanyel">
                    {:lang('Previous page')}：
                    {empty name="$next.pre.id"}{:lang('No')}{else /}
                    <a title="{$next.pre.title}" href="{:url(\''.\\think\\Request::instance()->controller().'/detailed',['id'=>$next.pre.id,'navid'=>$next.pre.cid])}">{$next.pre.title}</a>
                    {/empty}
                </div>

                <div class="conY_fanyer">
                    {:lang('Next page')}：
                    {empty name="$next.next.id"}{:lang('No')}{else /}
                    <a title="{$next.next.title}" href="{:url(\''.\\think\\Request::instance()->controller().'/detailed',['id'=>$next.next.id,'navid'=>$next.next.cid])}">{$next.next.title}</a>
                    {/empty}
                </div>
            </div>
        </div>

    </div>

</div>

{/block}